package edu.cn.neusoft.dm.showweb.bean.dealform

/**
 * author:纷羽
 * create at 2018/7/13
 */
val LOGIN_FAILED = 400

open class DefaultResponse {

    var success: Int

    var message: Error? = null

    private constructor(success: Boolean, code: Int?, msg: String?) {
        if (success) {
            this.success = 1
        } else {
            this.success = 0
            val error = Error()
            error.code = code
            error.msg = msg
            this.message = error
        }
    }

    constructor(code: Int?, msg: String?) : this(success = false, code = code, msg = msg)

    constructor() : this(success = true, code = null, msg = null)
}

class Error {

    var code: Int? = null

    var msg: String? = null
}
